﻿<Window x:Class="Win32Wrapper.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:converter="clr-namespace:Win32Wrapper.Converter"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <converter:WindowStyleConverter x:Key="WindowStyleConverter1" />
        <converter:ExtendedWindowStyleConverter x:Key="ExtendedWindowStyleConverter1" />
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="400*" />
            <ColumnDefinition Width="200" MinWidth="200" MaxWidth="350"/>
        </Grid.ColumnDefinitions>
        <ListView Margin="12,12,12,42" Name="listView1">
            <ListView.GroupStyle>
                <GroupStyle HidesIfEmpty="False">
                    <GroupStyle.ContainerStyle>
                        <Style TargetType="GroupItem">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="GroupItem">
                                        <Expander IsExpanded="True">
                                            <Expander.Header>
                                                <TextBlock TextWrapping="Wrap" Margin="0,10,0,5" >
													<Bold><TextBlock Text="{Binding Name}"/></Bold>
												</TextBlock>
                                            </Expander.Header>
                                            <ItemsPresenter/>
                                        </Expander>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </GroupStyle.ContainerStyle>
                </GroupStyle>
            </ListView.GroupStyle>
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Title">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Width="20" Height="20" Source="{Binding Image}"/>
                                    <TextBlock Margin="1,0,0,0" Text="{Binding Title}"/>
                                </StackPanel>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="hWnd" DisplayMemberBinding="{Binding hWnd}"/>
                    <GridViewColumn Header="Process" DisplayMemberBinding="{Binding Process.MainModule.FileName}"/>
                    <GridViewColumn Header="Process" DisplayMemberBinding="{Binding Process.ProcessName}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Button Content="Aktualisieren" Margin="12,0,12,12" Name="RefreshButton" Height="23" VerticalAlignment="Bottom" Click="RefreshButton_Click"/>
        <GridSplitter Width="6" HorizontalAlignment="Right" Margin="0,0,-3,0"/>
        <ScrollViewer  Grid.Column="1" Margin="12" VerticalScrollBarVisibility="Auto">
            <StackPanel>
                <Expander Header="Informationen">
                <StackPanel >
                    <WrapPanel ToolTip="{Binding ElementName=listView1, Path=SelectedItem.Content.Title}">
                        <Image Height="30" Width="30" Source="{Binding ElementName=listView1, Path=SelectedItem.Content.Image}"/>
                        <TextBlock Text="{Binding ElementName=listView1, Path=SelectedItem.Content.Title}" VerticalAlignment="Center" />
                    </WrapPanel>

                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="hWnd:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.hWnd}"/>
                    </StackPanel>

                    <TextBlock Margin="0,12,0,0" Text="Window Info" TextDecorations="UnderLine"/>
                    <StackPanel Margin="0,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="cbSize:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.cbSize}"/>
                    </StackPanel>
                    <TextBlock Margin="0,2,0,0" Text="rcWindow:"/>
                    <StackPanel Margin="50,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="Left:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.rcWindow.left}"/>
                    </StackPanel>
                    <StackPanel Margin="50,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="Top:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.rcWindow.top}"/>
                    </StackPanel>
                    <StackPanel Margin="50,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="Right:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.rcWindow.right}"/>
                    </StackPanel>
                    <StackPanel Margin="50,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="Bottom:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.rcWindow.bottom}"/>
                    </StackPanel>

                    <TextBlock Margin="0,2,0,0" Text="rcClient:"/>
                    <StackPanel Margin="50,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="Left:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.rcClient.left}"/>
                    </StackPanel>
                    <StackPanel Margin="50,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="Top:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.rcClient.top}"/>
                    </StackPanel>
                    <StackPanel Margin="50,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="Right:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.rcClient.right}"/>
                    </StackPanel>
                    <StackPanel Margin="50,2,0,0" Orientation="Horizontal">
                        <TextBlock Text="Bottom:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.rcClient.bottom}"/>
                    </StackPanel>

                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="dwStyle:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.dwStyle, Converter={StaticResource WindowStyleConverter1}}"/>
                    </StackPanel>

                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="dwExStyle:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.dwExStyle, Converter={StaticResource ExtendedWindowStyleConverter1}}"/>
                    </StackPanel>

                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="dwWindowStatus:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.dwWindowStatus}"/>
                    </StackPanel>

                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="cxWindowBorders:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.cxWindowBorders}"/>
                    </StackPanel>

                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="cyWindowBorders:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.cyWindowBorders}"/>
                    </StackPanel>

                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="atomWindowType:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.atomWindowType}"/>
                    </StackPanel>

                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="wCreatorVersion:"/>
                        <TextBlock Margin="4,0,0,0" Text="{Binding ElementName=listView1, Path=SelectedItem.Content.WindowInfo.wCreatorVersion}"/>
                    </StackPanel>
                </StackPanel>
            </Expander>
                <Expander Header="Verändern">
                    <StackPanel>
                        <TextBlock Text="Title:"/>
                        <TextBox Margin="0,2,0,0" Name="ChangeTitleTextBox"></TextBox>
                        <Button Margin="0,2,0,0" HorizontalAlignment="Right" Width="50" Name="ChangeTitleButton" Click="ChangeTitleButton_Click">Ok</Button>
                    </StackPanel>
                </Expander>
            </StackPanel>
        </ScrollViewer>
        
    </Grid>
</Window>
